<?php

namespace App\Repository\Repositories;

use App\Repository\Models\Company;
use App\Repository\Repositories\Interfaces\CompanyRepository;

/**
 * Class CompanyRepositoryEloquent.
 *
 * @package namespace App\Repository\Repositories;
 */
class CompanyRepositoryEloquent extends BaseRepository implements CompanyRepository
{
    /**
     * 搜索
     * @var array
     */
    protected $fieldSearchable = [
    ];

    /**
     * Specify Model class name
     *
     * @return string
     */
    public function model()
    {
        return Company::class;
    }

    //检查公司信息是否存在
    public function checkCompany($user_id)
    {
        $data = $this->query()->where('user_id',$user_id)->first();

        $data = $data ? $data->toArray(): '';

        return $data;
    }
}
